<!DOCTYPE html>
<html lang="en-US" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>shell | 中华文档库</title>
    <meta name="description" content="A VitePress site">
    <link rel="preload stylesheet" href="/docs/assets/style.beebbf61.css" as="style">
    <script type="module" src="/docs/assets/app.65379622.js"></script>
    <link rel="preload" href="/docs/assets/inter-roman-latin.2ed14f66.woff2" as="font" type="font/woff2" crossorigin="">
  <link rel="modulepreload" href="/docs/assets/chunks/framework.9a026969.js">
  <link rel="modulepreload" href="/docs/assets/chunks/theme.f887af6c.js">
  <link rel="modulepreload" href="/docs/assets/backend_shell.md.d55b3613.lean.js">
  <link rel="icon" type="image/svg+xml" href="https://foruda.gitee.com/avatar/1662445450649625813/1624674_except-one_1662445449.png">
  <meta name="description" content="Libraries created by VitePress">
  <meta name="keywords" content="JavaScript,Laravel,Thinkphp,Python,Node,Vue3">
  <meta name="author" content="deeperee">
  <script id="check-dark-light">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-4f197c35><!--[--><!--]--><!--[--><span tabindex="-1" data-v-398deaa1></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-398deaa1> Skip to content </a><!--]--><!----><header class="VPNav" data-v-4f197c35 data-v-e55c7d48><div class="VPNavBar has-sidebar" data-v-e55c7d48 data-v-b81b2d2a><div class="container" data-v-b81b2d2a><div class="title" data-v-b81b2d2a><div class="VPNavBarTitle has-sidebar" data-v-b81b2d2a data-v-7290950d><a class="title" href="/docs/" data-v-7290950d><!--[--><!--]--><!--[--><img class="VPImage logo" src="https://foruda.gitee.com/avatar/1662445450649625813/1624674_except-one_1662445449.png" alt data-v-e8fda39b><!--]--><!--[-->中华文档库<!--]--><!--[--><!--]--></a></div></div><div class="content" data-v-b81b2d2a><div class="curtain" data-v-b81b2d2a></div><div class="content-body" data-v-b81b2d2a><!--[--><!--]--><div class="VPNavBarSearch search" style="--vp-meta-key:&#39;Meta&#39;;" data-v-b81b2d2a><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg class="DocSearch-Search-Icon" width="20" height="20" viewBox="0 0 20 20" aria-label="search icon"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-b81b2d2a data-v-eca4ce12><span id="main-nav-aria-label" class="visually-hidden" data-v-eca4ce12>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/docs/sharp-sword/" tabindex="0" data-v-eca4ce12 data-v-07e518bf data-v-b5ae80c8><!--[-->利剑<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/docs/frontend/" tabindex="0" data-v-eca4ce12 data-v-07e518bf data-v-b5ae80c8><!--[-->前端<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/docs/backend/" tabindex="0" data-v-eca4ce12 data-v-07e518bf data-v-b5ae80c8><!--[-->后端<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/docs/environment/" tabindex="0" data-v-eca4ce12 data-v-07e518bf data-v-b5ae80c8><!--[-->服务<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/docs/software/" tabindex="0" data-v-eca4ce12 data-v-07e518bf data-v-b5ae80c8><!--[-->软件<!--]--><!----></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-b81b2d2a data-v-409d64f6><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-409d64f6 data-v-94efbe2e data-v-d6a5970a><span class="check" data-v-d6a5970a><span class="icon" data-v-d6a5970a><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-94efbe2e><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-94efbe2e><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-b81b2d2a data-v-1d3ce246 data-v-4a9f6b90><!--[--><a class="VPSocialLink" href="https://gitee.com/Except-one/" aria-label="github" target="_blank" rel="noopener" data-v-4a9f6b90 data-v-6de7ee81><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><a class="VPSocialLink" href="https://github.com/deeperee/" aria-label="github" target="_blank" rel="noopener" data-v-4a9f6b90 data-v-6de7ee81><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-b81b2d2a data-v-6d7ae577 data-v-541ff04c><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-541ff04c><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-541ff04c><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-541ff04c><div class="VPMenu" data-v-541ff04c data-v-8a79d938><!----><!--[--><!--[--><!----><div class="group" data-v-6d7ae577><div class="item appearance" data-v-6d7ae577><p class="label" data-v-6d7ae577>Appearance</p><div class="appearance-action" data-v-6d7ae577><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="toggle dark mode" aria-checked="false" data-v-6d7ae577 data-v-94efbe2e data-v-d6a5970a><span class="check" data-v-d6a5970a><span class="icon" data-v-d6a5970a><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-94efbe2e><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-94efbe2e><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div></div></div><div class="group" data-v-6d7ae577><div class="item social-links" data-v-6d7ae577><div class="VPSocialLinks social-links-list" data-v-6d7ae577 data-v-4a9f6b90><!--[--><a class="VPSocialLink" href="https://gitee.com/Except-one/" aria-label="github" target="_blank" rel="noopener" data-v-4a9f6b90 data-v-6de7ee81><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><a class="VPSocialLink" href="https://github.com/deeperee/" aria-label="github" target="_blank" rel="noopener" data-v-4a9f6b90 data-v-6de7ee81><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-b81b2d2a data-v-7744d315><span class="container" data-v-7744d315><span class="top" data-v-7744d315></span><span class="middle" data-v-7744d315></span><span class="bottom" data-v-7744d315></span></span></button></div></div></div></div><!----></header><div class="VPLocalNav" data-v-4f197c35 data-v-80ba5e0c><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-80ba5e0c><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="menu-icon" data-v-80ba5e0c><path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path></svg><span class="menu-text" data-v-80ba5e0c>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-80ba5e0c data-v-96e3780d><button data-v-96e3780d>Return to top</button><!----></div></div><aside class="VPSidebar" data-v-4f197c35 data-v-b6f99f93><div class="curtain" data-v-b6f99f93></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-b6f99f93><span class="visually-hidden" id="sidebar-aria-label" data-v-b6f99f93> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-b6f99f93><section class="VPSidebarItem level-0 has-active" data-v-b6f99f93 data-v-e89623a4><!----><div class="items" data-v-e89623a4><!--[--><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/index.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>HTTP状态码</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/api.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>API开发</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/composer.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>Composer</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/database.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>Database</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/laravel.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>Laravel 8.x</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/thinkphp6.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>ThinkPHP 6.x</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/fast-admin.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>Fast-admin</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/php-advanced.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>PHP 高级函数</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/php-bc-function.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>PHP BC运算函数</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/php-vender.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>PHP 扩展插件</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/python.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>Python3</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link is-active has-active" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/shell.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>SHELL</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/wechat.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>微信开发</p><!--]--><!----></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-e89623a4 data-v-e89623a4><div class="item" data-v-e89623a4><div class="indicator" data-v-e89623a4></div><a class="VPLink link link" href="/docs/backend/dollar.html" data-v-e89623a4 data-v-b5ae80c8><!--[--><p class="text" data-v-e89623a4>~~彩蛋~~</p><!--]--><!----></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-4f197c35 data-v-251b6042><div class="VPDoc has-sidebar has-aside" data-v-251b6042 data-v-0618013c><!--[--><!--]--><div class="container" data-v-0618013c><div class="aside" data-v-0618013c><div class="aside-curtain" data-v-0618013c></div><div class="aside-container" data-v-0618013c><div class="aside-content" data-v-0618013c><div class="VPDocAside" data-v-0618013c data-v-a927bda4><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" data-v-a927bda4 data-v-aa3da25a><div class="content" data-v-aa3da25a><div class="outline-marker" data-v-aa3da25a></div><div class="outline-title" data-v-aa3da25a>On this page</div><nav aria-labelledby="doc-outline-aria-label" data-v-aa3da25a><span class="visually-hidden" id="doc-outline-aria-label" data-v-aa3da25a> Table of Contents for current page </span><ul class="root" data-v-aa3da25a data-v-c23508ae><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-a927bda4></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-0618013c><div class="content-container" data-v-0618013c><!--[--><!--]--><!----><main class="main" data-v-0618013c><div style="position:relative;" class="vp-doc _docs_backend_shell" data-v-0618013c><div><h1 id="shell-脚本" tabindex="-1">SHELL 脚本 <a class="header-anchor" href="#shell-脚本" aria-label="Permalink to &quot;SHELL 脚本&quot;">​</a></h1><h2 id="接收参数" tabindex="-1">接收参数 <a class="header-anchor" href="#接收参数" aria-label="Permalink to &quot;接收参数&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># 创建脚本文件(demo.sh)， 内容如下：</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;">#!/bin/bash</span></span>
<span class="line"></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;">$*</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># 获取所有参数</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;font-style:italic;">$0</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># 0是文件自己的名称</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;font-style:italic;">$1</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># 获取第一个参数</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;font-style:italic;">$2</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;font-style:italic;">${10}</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#82AAFF;">exit</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># 命令行运行脚本文件</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">sh</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">demo.sh</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-v</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">7.4</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-p</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">9074</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-u</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">root</span></span>
<span class="line"><span style="color:#FFCB6B;">-v</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">7.4</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-p</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">9074</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-u</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">root</span></span>
<span class="line"><span style="color:#FFCB6B;">demo.sh</span></span>
<span class="line"><span style="color:#FFCB6B;">-v</span></span>
<span class="line"><span style="color:#FFCB6B;">7.4</span></span>
<span class="line"><span style="color:#FFCB6B;">-p</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><h2 id="获取进程的pid" tabindex="-1">获取进程的PID <a class="header-anchor" href="#获取进程的pid" aria-label="Permalink to &quot;获取进程的PID&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># grep httpd 		查找 httpd 进程</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># grep -v grep		排除含有 grep 项</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># awk &#39;{print $2}&#39;  获取 PID</span></span>
<span class="line"><span style="color:#FFCB6B;">ps</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-ef</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">httpd</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-v</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">awk</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">{print $2}</span><span style="color:#89DDFF;">&#39;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="根据pid杀掉进程" tabindex="-1">根据PID杀掉进程 <a class="header-anchor" href="#根据pid杀掉进程" aria-label="Permalink to &quot;根据PID杀掉进程&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># 方式一</span></span>
<span class="line"><span style="color:#82AAFF;">kill</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-9</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">ps</span><span style="color:#C3E88D;"> -ef </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> httpd </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> -v grep </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">awk</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">{print $2}</span><span style="color:#89DDFF;">&#39;)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 方式二</span></span>
<span class="line"><span style="color:#FFCB6B;">ps</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-ef</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">httpd</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-v</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">awk</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">{print $2}</span><span style="color:#89DDFF;">&#39;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">xargs</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">kill</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-9</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="时间-date-操作" tabindex="-1">时间(date)操作 <a class="header-anchor" href="#时间-date-操作" aria-label="Permalink to &quot;时间(date)操作&quot;">​</a></h2><table><thead><tr><th style="text-align:center;">Linux、Centos、Ubuntu</th><th style="text-align:center;">MacOs</th></tr></thead><tbody><tr><td style="text-align:center;"><code>date -d </code></td><td style="text-align:center;"><code>date -v </code></td></tr><tr><td style="text-align:center;">字符串 ==&gt; 时间戳</td><td style="text-align:center;">字符串 ==&gt; 时间戳</td></tr><tr><td style="text-align:center;"><code>date -d &quot;2016-12-25 03:00:00&quot; &quot;+%s&quot;</code> <br>#1482606000</td><td style="text-align:center;"><code>date -j -f &quot;%F %T&quot; &quot;2016-12-25 03:00:00&quot; &quot;+%s&quot; </code><br> #1482606000</td></tr><tr><td style="text-align:center;">时间戳 ==&gt; 字符串</td><td style="text-align:center;">时间戳 ==&gt; 字符串</td></tr><tr><td style="text-align:center;"><code>date -d @1482606000 &quot;+%F %T&quot;</code> <br># 2016-12-25 03:00:00</td><td style="text-align:center;"><code>date -r 1482606000 &quot;+%F %T&quot;</code><br>#2016-12-25 03:00:00</td></tr></tbody></table><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">serverdate</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">Aug 16 05:53:39 2021 GMT</span><span style="color:#89DDFF;">&quot;</span></span>
<span class="line"><span style="color:#A6ACCD;">servertime</span><span style="color:#89DDFF;">=</span><span style="color:#F78C6C;">0</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;">#1628063755</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">if</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">[[</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -a</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=~</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">Linux</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">]];</span><span style="color:#89DDFF;font-style:italic;">then</span></span>
<span class="line"><span style="color:#A6ACCD;">	</span></span>
<span class="line"><span style="color:#A6ACCD;">	</span><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">date</span><span style="color:#C3E88D;"> -d </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">serverdate</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> +%F</span><span style="color:#A6ACCD;">\ </span><span style="color:#C3E88D;">%T</span><span style="color:#89DDFF;">)</span></span>
<span class="line"><span style="color:#A6ACCD;">	</span><span style="color:#676E95;font-style:italic;"># 时间戳</span></span>
<span class="line"><span style="color:#A6ACCD;">	servertime</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">date</span><span style="color:#C3E88D;"> -d </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">serverdate</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> +%s</span><span style="color:#89DDFF;">)</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">elif</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">[[</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -a</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">=~</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">Darwin</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">]];</span><span style="color:#89DDFF;font-style:italic;">then</span></span>
<span class="line"></span>
<span class="line"><span style="color:#A6ACCD;">	</span><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">date</span><span style="color:#C3E88D;"> -v </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">serverdate</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> +%F</span><span style="color:#A6ACCD;">\ </span><span style="color:#C3E88D;">%T</span><span style="color:#89DDFF;">)</span></span>
<span class="line"><span style="color:#A6ACCD;">	</span><span style="color:#676E95;font-style:italic;"># 时间戳</span></span>
<span class="line"><span style="color:#A6ACCD;">	servertime</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">date</span><span style="color:#C3E88D;"> -v </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">serverdate</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> +%s</span><span style="color:#89DDFF;">)</span></span>
<span class="line"><span style="color:#89DDFF;font-style:italic;">fi</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 时间运算 </span></span>
<span class="line"><span style="color:#A6ACCD;">currtime</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">date</span><span style="color:#C3E88D;"> +%s</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># 1622793368</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">expr</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">expr</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">servertime</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> - </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">currtime</span><span style="color:#89DDFF;">})</span><span style="color:#C3E88D;"> / </span><span style="color:#F78C6C;">86400</span><span style="color:#89DDFF;">)</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br></div></div><h2 id="逻辑运算符" tabindex="-1">逻辑运算符 <a class="header-anchor" href="#逻辑运算符" aria-label="Permalink to &quot;逻辑运算符&quot;">​</a></h2><table><thead><tr><th style="text-align:center;">逻辑运算符</th><th style="text-align:center;">描述</th><th style="text-align:center;">相对于其他语言</th></tr></thead><tbody><tr><td style="text-align:center;">-a</td><td style="text-align:center;">与</td><td style="text-align:center;">&amp;&amp;</td></tr><tr><td style="text-align:center;">-o</td><td style="text-align:center;">或</td><td style="text-align:center;">||</td></tr><tr><td style="text-align:center;">!</td><td style="text-align:center;">非</td><td style="text-align:center;">!</td></tr></tbody></table><h2 id="运算符" tabindex="-1">运算符 <a class="header-anchor" href="#运算符" aria-label="Permalink to &quot;运算符&quot;">​</a></h2><table><thead><tr><th style="text-align:center;">运算符</th><th style="text-align:center;">描述</th></tr></thead><tbody><tr><td style="text-align:center;">-eq</td><td style="text-align:center;">等于 (=)</td></tr><tr><td style="text-align:center;">-ne</td><td style="text-align:center;">不等于 (≠)</td></tr><tr><td style="text-align:center;">-gt</td><td style="text-align:center;">大于 (&gt;)</td></tr><tr><td style="text-align:center;">-lt</td><td style="text-align:center;">小于 (&lt;)</td></tr><tr><td style="text-align:center;">-ge</td><td style="text-align:center;">大于等于 (≥)</td></tr><tr><td style="text-align:center;">-le</td><td style="text-align:center;">小于等于 (≤)</td></tr></tbody></table><h2 id="curl检测域名是否正常" tabindex="-1">curl检测域名是否正常 <a class="header-anchor" href="#curl检测域名是否正常" aria-label="Permalink to &quot;curl检测域名是否正常&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">curl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-I</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-m</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">10</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-o</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">/dev/null</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-s</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-w</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">%{http_code}</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">domain</span><span style="color:#89DDFF;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#FFCB6B;">-I</span><span style="color:#A6ACCD;"> 					</span><span style="color:#C3E88D;">测试HTTP头</span></span>
<span class="line"><span style="color:#FFCB6B;">-m</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">10</span><span style="color:#A6ACCD;"> 				</span><span style="color:#C3E88D;">最多查询10s</span></span>
<span class="line"><span style="color:#FFCB6B;">-o</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">/dev/null</span><span style="color:#A6ACCD;"> 		</span><span style="color:#C3E88D;">屏蔽原有输出信息</span></span>
<span class="line"><span style="color:#FFCB6B;">-s</span><span style="color:#A6ACCD;"> 					</span><span style="color:#C3E88D;">silent</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">模式，不输出任何东西</span></span>
<span class="line"><span style="color:#FFCB6B;">-w</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">%{http_code}</span><span style="color:#A6ACCD;">		</span><span style="color:#C3E88D;">控制额外输出</span></span>
<span class="line"><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">domain</span><span style="color:#89DDFF;">}</span><span style="color:#A6ACCD;">			需要检测的站点		</span></span>
<span class="line"></span>
<span class="line"><span style="color:#FFCB6B;">eg:</span></span>
<span class="line"><span style="color:#FFCB6B;">curl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-I</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-m</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">10</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-o</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">/dev/null</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-s</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-w</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">%{http_code}</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">www.baidu.com</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 200</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><h2 id="cat-写入内容" tabindex="-1">cat 写入内容 <a class="header-anchor" href="#cat-写入内容" aria-label="Permalink to &quot;cat 写入内容&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">cat</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&gt;</span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">/usr/local/apache/conf/vhost/</span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">domain</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">.conf</span><span style="color:#89DDFF;">&quot;</span><span style="color:#89DDFF;">&lt;&lt;</span><span style="color:#89DDFF;">EOF</span></span>
<span class="line"><span style="color:#C3E88D;">&lt;VirtualHost *:80&gt;</span></span>
<span class="line"><span style="color:#C3E88D;">ServerAdmin </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">email</span><span style="color:#89DDFF;">}</span></span>
<span class="line"><span style="color:#C3E88D;">php_admin_value open_basedir &quot;</span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">vhostdir</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">:/tmp/:/var/tmp/:/proc/&quot;</span></span>
<span class="line"><span style="color:#C3E88D;">DocumentRoot &quot;</span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">vhostdir</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">&quot;</span></span>
<span class="line"><span style="color:#C3E88D;">ServerName </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">domain</span><span style="color:#89DDFF;">}</span></span>
<span class="line"><span style="color:#C3E88D;">ErrorLog &quot;/home/wwwlogs/</span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">al_name</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">-error_log&quot;</span></span>
<span class="line"><span style="color:#C3E88D;">CustomLog &quot;/home/wwwlogs/</span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">al_name</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">-access_log&quot; combined</span></span>
<span class="line"><span style="color:#C3E88D;">&lt;Directory &quot;</span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">vhostdir</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">&quot;&gt;</span></span>
<span class="line"><span style="color:#C3E88D;">    SetOutputFilter DEFLATE</span></span>
<span class="line"><span style="color:#C3E88D;">    Options FollowSymLinks</span></span>
<span class="line"><span style="color:#C3E88D;">    AllowOverride All</span></span>
<span class="line"><span style="color:#C3E88D;">    Order allow,deny</span></span>
<span class="line"><span style="color:#C3E88D;">    Allow from all</span></span>
<span class="line"><span style="color:#C3E88D;">    DirectoryIndex index.html index.php</span></span>
<span class="line"><span style="color:#C3E88D;">&lt;/Directory&gt;</span></span>
<span class="line"><span style="color:#C3E88D;">&lt;/VirtualHost&gt;</span></span>
<span class="line"><span style="color:#89DDFF;">EOF</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br></div></div><h2 id="cut-用法" tabindex="-1">cut 用法 <a class="header-anchor" href="#cut-用法" aria-label="Permalink to &quot;cut 用法&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">sw_vers</span></span>
<span class="line"><span style="color:#FFCB6B;">ProductName:</span><span style="color:#A6ACCD;">	</span><span style="color:#C3E88D;">Mac</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">OS</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">X</span></span>
<span class="line"><span style="color:#FFCB6B;">ProductVersion:</span><span style="color:#A6ACCD;">	</span><span style="color:#F78C6C;">10.15</span><span style="color:#C3E88D;">.7</span></span>
<span class="line"><span style="color:#FFCB6B;">BuildVersion:</span><span style="color:#A6ACCD;">	</span><span style="color:#F78C6C;">19</span><span style="color:#C3E88D;">H2</span></span>
<span class="line"></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">sw_vers</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-productVersion</span></span>
<span class="line"><span style="color:#FFCB6B;">10.15.7</span></span>
<span class="line"></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">sw_vers</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-productVersion</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">cut</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-d.</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-f1</span></span>
<span class="line"><span style="color:#FFCB6B;">10</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">sw_vers</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-productVersion</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">cut</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-d.</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-f2</span></span>
<span class="line"><span style="color:#FFCB6B;">15</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">sw_vers</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-productVersion</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">cut</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-d.</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-f3</span></span>
<span class="line"><span style="color:#FFCB6B;">7</span></span>
<span class="line"></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">$((</span></span>
<span class="line"><span style="color:#A6ACCD;">	$(sw_vers -productVersion | cut -d. -f1) * 10000 +</span></span>
<span class="line"><span style="color:#A6ACCD;">	</span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">sw_vers</span><span style="color:#C3E88D;"> -productVersion </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">cut</span><span style="color:#C3E88D;"> -d. -f2</span><span style="color:#89DDFF;">)</span><span style="color:#A6ACCD;"> </span><span style="color:#A6ACCD;">*</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">100</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">+</span></span>
<span class="line"><span style="color:#A6ACCD;">	</span><span style="color:#FFCB6B;">$(sw_vers</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-productVersion</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">cut</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-d.</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-f3</span><span style="color:#A6ACCD;">)</span></span>
<span class="line"><span style="color:#A6ACCD;">	))</span></span>
<span class="line"><span style="color:#FFCB6B;">101507</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br></div></div><h2 id="sed-用法" tabindex="-1">sed 用法 <a class="header-anchor" href="#sed-用法" aria-label="Permalink to &quot;sed 用法&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># 替换 空格 为 空</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">* * php hello * *</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">s/\ //g</span><span style="color:#89DDFF;">&#39;</span></span>
<span class="line"><span style="color:#89DDFF;">**</span><span style="color:#A6ACCD;">phphello</span><span style="color:#89DDFF;">**</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 把 . 剔除</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">php@7.4</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">s/\.//</span><span style="color:#89DDFF;">&#39;</span></span>
<span class="line"><span style="color:#FFCB6B;">php@74</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 把 php@ 和 . 替换成空</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">php@7.4</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">s/\.//</span><span style="color:#89DDFF;">&#39;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">s/^php@//</span><span style="color:#89DDFF;">&#39;</span></span>
<span class="line"><span style="color:#FFCB6B;">74</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 把 \ 替换成空</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">php@\/7.4</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">s/\\//</span><span style="color:#89DDFF;">&#39;</span></span>
<span class="line"><span style="color:#FFCB6B;">php@/7.4</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><blockquote><p>直接修改文件内容：demo.txt</p></blockquote><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">cat</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">./demo.txt</span></span>
<span class="line"><span style="color:#89DDFF;">[</span><span style="color:#A6ACCD;">app</span><span style="color:#89DDFF;">]</span></span>
<span class="line"><span style="color:#A6ACCD;">debug</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">true</span></span>
<span class="line"></span>
<span class="line"><span style="color:#89DDFF;">[</span><span style="color:#A6ACCD;">database</span><span style="color:#89DDFF;">]</span></span>
<span class="line"><span style="color:#A6ACCD;">database</span><span style="color:#89DDFF;">=</span><span style="color:#C3E88D;">easyadmin</span></span>
<span class="line"><span style="color:#A6ACCD;">username</span><span style="color:#89DDFF;">=</span><span style="color:#C3E88D;">root</span></span>
<span class="line"><span style="color:#A6ACCD;">hostport</span><span style="color:#89DDFF;">=</span><span style="color:#F78C6C;">3306</span></span>
<span class="line"><span style="color:#A6ACCD;">prefix</span><span style="color:#89DDFF;">=</span><span style="color:#C3E88D;">ea_</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 替换文件内容 [php] 为 [PHP]</span></span>
<span class="line"><span style="color:#FFCB6B;">sed</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-i</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">.bak</span><span style="color:#89DDFF;">&#39;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&#39;</span><span style="color:#C3E88D;">s#\[(.)\]#\[APP\]#</span><span style="color:#89DDFF;">&#39;</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">./demo.txt</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><h2 id="basename、dirname、realpath" tabindex="-1">basename、dirname、realpath <a class="header-anchor" href="#basename、dirname、realpath" aria-label="Permalink to &quot;basename、dirname、realpath&quot;">​</a></h2><table><thead><tr><th style="text-align:center;">指令</th><th style="text-align:left;">描述</th><th style="text-align:left;">用法</th></tr></thead><tbody><tr><td style="text-align:center;">basename</td><td style="text-align:left;">从路径中提取出文件名</td><td style="text-align:left;"><code>basename ${dirPath} [SUFFIX]</code></td></tr><tr><td style="text-align:center;">dirname</td><td style="text-align:left;">从路径中提取出目录名</td><td style="text-align:left;"><code>dirname ${dirPath}</code></td></tr><tr><td style="text-align:center;">realpath</td><td style="text-align:left;">获取文件的绝对路径</td><td style="text-align:left;"><code>realpath ${filename}</code></td></tr></tbody></table><div class="language-bash line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> basename </span><span style="color:#89DDFF;">~</span><span style="color:#A6ACCD;">/Download/icon.png</span></span>
<span class="line"><span style="color:#FFCB6B;">icon.png</span></span>
<span class="line"></span>
<span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> basename </span><span style="color:#89DDFF;">~</span><span style="color:#A6ACCD;">/Download/icon.png .png</span></span>
<span class="line"><span style="color:#FFCB6B;">icon</span></span>
<span class="line"></span>
<span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> dirname </span><span style="color:#89DDFF;">~</span><span style="color:#A6ACCD;">/Download/icon.png</span></span>
<span class="line"><span style="color:#FFCB6B;">/Users/yourname/Downloads</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><h2 id="截取字符" tabindex="-1">截取字符 <a class="header-anchor" href="#截取字符" aria-label="Permalink to &quot;截取字符&quot;">​</a></h2><table><thead><tr><th style="text-align:center;">符号</th><th style="text-align:center;">示例</th><th>描述</th></tr></thead><tbody><tr><td style="text-align:center;">*</td><td style="text-align:center;"><code>*</code></td><td>要删除的内容</td></tr><tr><td style="text-align:center;">#</td><td style="text-align:center;"><code>#*/</code></td><td></td></tr><tr><td style="text-align:center;"></td><td style="text-align:center;"><code>#*.</code></td><td>从右边开始截取到最后一个<code>.</code>结束</td></tr><tr><td style="text-align:center;">%</td><td style="text-align:center;"><code>%.*</code></td><td></td></tr><tr><td style="text-align:center;">##</td><td style="text-align:center;"></td><td></td></tr><tr><td style="text-align:center;">%%</td><td style="text-align:center;"></td><td></td></tr><tr><td style="text-align:center;"></td><td style="text-align:center;"></td><td></td></tr><tr><td style="text-align:center;"></td><td style="text-align:center;"></td><td></td></tr></tbody></table><h4 id="获取文件名称-包含后缀" tabindex="-1"><code>##*/</code>- 获取文件名称（包含后缀） <a class="header-anchor" href="#获取文件名称-包含后缀" aria-label="Permalink to &quot;`##*/`- 获取文件名称（包含后缀）&quot;">​</a></h4><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">=</span><span style="color:#C3E88D;">/root/local/node-v14.15.4-linux-x64.tar.xz</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">##*/}</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># node-v14.15.4-linux-x64.tar.xz</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h4 id="或者-提取文件后缀" tabindex="-1">[<code>##*.</code>] 或者 [ <code>#*.</code>] - 提取文件后缀 <a class="header-anchor" href="#或者-提取文件后缀" aria-label="Permalink to &quot;[`##*.`] 或者 [ `#*.`] - 提取文件后缀&quot;">​</a></h4><ul><li><code>##*.</code> - 从右边开始截取到第一个<code>.</code>结束</li><li><code>#*.</code> - 从右边开始截取到最后一个<code>.</code>结束</li></ul><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">=</span><span style="color:#C3E88D;">/root/local/node-v14.15.4-linux-x64.tar.xz</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">##*</span><span style="color:#A6ACCD;">.</span><span style="color:#89DDFF;">}</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># xz （并不是我们想要的后缀）</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">#*</span><span style="color:#A6ACCD;">.</span><span style="color:#89DDFF;">}</span><span style="color:#A6ACCD;">  </span><span style="color:#676E95;font-style:italic;"># 15.4-linux-x64.tar.xz （并不是我们想要的后缀）</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h4 id="获取文件的上级目录结构" tabindex="-1"><code>%/*</code> - 获取文件的上级目录结构 <a class="header-anchor" href="#获取文件的上级目录结构" aria-label="Permalink to &quot;`%/*` - 获取文件的上级目录结构&quot;">​</a></h4><ul><li><code>%/*</code> 从左边开始截取到第后一个<code>/</code>结束</li></ul><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">=</span><span style="color:#C3E88D;">/root/local/node-v14.15.4-linux-x64.tar.xz</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">%/*}</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># /root/local</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h4 id="从左边开始截取到第一个-结束" tabindex="-1"><code>%%.*</code> - 从左边开始截取到第一个<code>.</code>结束 <a class="header-anchor" href="#从左边开始截取到第一个-结束" aria-label="Permalink to &quot;`%%.*` - 从左边开始截取到第一个`.`结束&quot;">​</a></h4><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">=</span><span style="color:#C3E88D;">/root/local/node-v14.15.4-linux-x64.tar.xz</span></span>
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">${</span><span style="color:#A6ACCD;">str</span><span style="color:#89DDFF;">%%</span><span style="color:#A6ACCD;">.</span><span style="color:#89DDFF;">*}</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># /root/local/node-v14 (刚好和 #*. 相反)</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h2 id="ls-grep-rm删除文件" tabindex="-1"><code>ls|grep|rm</code>删除文件 <a class="header-anchor" href="#ls-grep-rm删除文件" aria-label="Permalink to &quot;`ls|grep|rm`删除文件&quot;">​</a></h2><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># 删除以 _thumb.jpg 结尾的图片</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">ls</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">_thumb.jpg$</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">xargs</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">rm</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-f</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 删除 _hd.jpg 之外（-v）的所有文件</span></span>
<span class="line"><span style="color:#FFCB6B;">$</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">ls</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-v</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&quot;</span><span style="color:#C3E88D;">_hd.jpg$</span><span style="color:#89DDFF;">&quot;</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">xargs</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">rm</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-f</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="find文件" tabindex="-1"><code>find</code>文件 <a class="header-anchor" href="#find文件" aria-label="Permalink to &quot;`find`文件&quot;">​</a></h2><ul><li>搜索文件</li></ul><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># $ 以php7.so结尾的文件</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># / 从根目录开始搜索</span></span>
<span class="line"><span style="color:#FFCB6B;">find</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">/</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">php7.so</span><span style="color:#A6ACCD;">$</span></span>
<span class="line"></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># 查找后缀以 .conf 结果的文件</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;"># . 当前目录下开始搜索</span></span>
<span class="line"><span style="color:#FFCB6B;">find</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">.</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">.cnf</span><span style="color:#A6ACCD;">$</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br></div></div><ul><li>取反搜索文件</li></ul><div class="language-sh line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;">#&lt;!--查找当前目录下的ini文件--&gt;</span></span>
<span class="line"><span style="color:#FFCB6B;">find</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">.</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">ini</span></span>
<span class="line"><span style="color:#676E95;font-style:italic;">#&lt;!--过滤掉PHP下面的ini--&gt;</span></span>
<span class="line"><span style="color:#FFCB6B;">find</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">.</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">ini</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-v</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">php</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="macos-date" tabindex="-1">MacOS - date <a class="header-anchor" href="#macos-date" aria-label="Permalink to &quot;MacOS - date&quot;">​</a></h2><h3 id="时间戳" tabindex="-1">时间戳 <a class="header-anchor" href="#时间戳" aria-label="Permalink to &quot;时间戳&quot;">​</a></h3><div class="language-bash line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> date +%s</span></span>
<span class="line"><span style="color:#FFCB6B;">1686206332</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h3 id="自定义格式" tabindex="-1">自定义格式 <a class="header-anchor" href="#自定义格式" aria-label="Permalink to &quot;自定义格式&quot;">​</a></h3><div class="language-bash line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> date +%Y%m%d%H%M%S</span></span>
<span class="line"><span style="color:#FFCB6B;">20230608143805</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><h3 id="时间戳格式化" tabindex="-1">时间戳格式化 <a class="header-anchor" href="#时间戳格式化" aria-label="Permalink to &quot;时间戳格式化&quot;">​</a></h3><div class="language-bash line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> date -r 1686206332    </span></span>
<span class="line"><span style="color:#FFCB6B;">2023年</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">6</span><span style="color:#C3E88D;">月</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">8</span><span style="color:#C3E88D;">日</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">星期四</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">14</span><span style="color:#C3E88D;">时38分52秒</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">CST</span></span>
<span class="line"></span>
<span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> date -r 1686206332 +%Y.%m.%d\ %H:%M:%S</span></span>
<span class="line"><span style="color:#FFCB6B;">2023.06.08</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">14</span><span style="color:#C3E88D;">:38:52</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h3 id="增加-减少对应的时间" tabindex="-1">+/- 增加/减少对应的时间 <a class="header-anchor" href="#增加-减少对应的时间" aria-label="Permalink to &quot;+/- 增加/减少对应的时间&quot;">​</a></h3><div class="language-bash line-numbers-mode"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> date -v+1m   </span><span style="color:#676E95;font-style:italic;"># 当前时间+1个月</span></span>
<span class="line"><span style="color:#FFCB6B;">2023年</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">7</span><span style="color:#C3E88D;">月</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">8</span><span style="color:#C3E88D;">日</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">星期六</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">14</span><span style="color:#C3E88D;">时43分55秒</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">CST</span></span>
<span class="line"></span>
<span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> date -v+2H   </span><span style="color:#676E95;font-style:italic;"># 当前时间+2小时</span></span>
<span class="line"><span style="color:#FFCB6B;">2023年</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">6</span><span style="color:#C3E88D;">月</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">8</span><span style="color:#C3E88D;">日</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">星期四</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">16</span><span style="color:#C3E88D;">时44分13秒</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">CST</span></span>
<span class="line"></span>
<span class="line"><span style="color:#89DDFF;">&gt;</span><span style="color:#A6ACCD;"> date -v+2H +%Y.%m.%d\ %H:%M:%Ss</span></span>
<span class="line"><span style="color:#FFCB6B;">2023.06.08</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">16</span><span style="color:#C3E88D;">:47:25</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div></div></div></main><footer class="VPDocFooter" data-v-0618013c data-v-1d44c82e><!--[--><!--]--><!----><div class="prev-next" data-v-1d44c82e><div class="pager" data-v-1d44c82e><a class="pager-link prev" href="/docs/backend/python.html" data-v-1d44c82e><span class="desc" data-v-1d44c82e>Previous page</span><span class="title" data-v-1d44c82e>Python3</span></a></div><div class="has-prev pager" data-v-1d44c82e><a class="pager-link next" href="/docs/backend/wechat.html" data-v-1d44c82e><span class="desc" data-v-1d44c82e>Next page</span><span class="title" data-v-1d44c82e>微信开发</span></a></div></div></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-4f197c35 data-v-dfe4da57><div class="container" data-v-dfe4da57><p class="message" data-v-dfe4da57>Released under the MIT License.</p><p class="copyright" data-v-dfe4da57>Copyright © 2019-present Deeperee</p></div></footer><!--[--><!--]--></div></div>
    <script>__VP_HASH_MAP__ = JSON.parse("{\"backend_composer.md\":\"ee7790f5\",\"backend_api.md\":\"949a23be\",\"backend_database.md\":\"05849cab\",\"backend_dollar.md\":\"d0be0a24\",\"backend_index.md\":\"3b647050\",\"backend_fast-admin.md\":\"df07b96c\",\"backend_php-vender.md\":\"d40957ce\",\"backend_php-bc-function.md\":\"87c7cbe3\",\"backend_laravel.md\":\"ce4b1d78\",\"backend_php-advanced.md\":\"577c22e6\",\"backend_thinkphp6.md\":\"c7f68674\",\"backend_shell.md\":\"d55b3613\",\"environment_index.md\":\"5373858b\",\"environment_centos.md\":\"0019d7ac\",\"frontend_formdata.md\":\"3db3d25f\",\"environment_crontab.md\":\"c16d3a94\",\"frontend_canvas.md\":\"38b4856c\",\"environment_bt.md\":\"fe682394\",\"backend_python.md\":\"a9236c98\",\"frontend_await.md\":\"ddc5025b\",\"frontend_es6.md\":\"3e600e99\",\"backend_wechat.md\":\"435c4b09\",\"frontend_normalization.md\":\"92f2a6d4\",\"index.md\":\"e8f91319\",\"sharp-sword_httpie.md\":\"66de0137\",\"sharp-sword_map.md\":\"3cd7f82b\",\"frontend_overload.md\":\"90b7a3e4\",\"sharp-sword_brew.md\":\"60a41600\",\"sharp-sword_index.md\":\"1f53cfa4\",\"frontend_ui-packing.md\":\"3ed339e0\",\"sharp-sword_algolia.md\":\"77c04496\",\"frontend_vite.md\":\"fde8b60f\",\"sharp-sword_whistle.md\":\"9e86bed9\",\"frontend_nestjs.md\":\"c79bdd92\",\"sharp-sword_git.md\":\"60e04651\",\"sharp-sword_yarn.md\":\"b82caeae\",\"software_index.md\":\"dffc2ab6\",\"frontend_request.md\":\"5e510b40\",\"frontend_vue.md\":\"f25eaded\",\"frontend_index.md\":\"8104cd19\"}")
__VP_SITE_DATA__ = JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"中华文档库\",\"description\":\"A VitePress site\",\"base\":\"/docs/\",\"head\":[],\"appearance\":true,\"themeConfig\":{\"logo\":\"https://foruda.gitee.com/avatar/1662445450649625813/1624674_except-one_1662445449.png\",\"search\":{\"provider\":\"local\"},\"socialLinks\":[{\"title\":\"GITEE\",\"icon\":\"github\",\"link\":\"https://gitee.com/Except-one/\"},{\"title\":\"GITHUB\",\"icon\":\"github\",\"link\":\"https://github.com/deeperee/\"}],\"lastUpdatedText\":\"最近更新时间\",\"nav\":[{\"text\":\"利剑\",\"link\":\"/sharp-sword/\",\"activeMatch\":\"^/sharp-sword/\"},{\"text\":\"前端\",\"link\":\"/frontend/\",\"activeMatch\":\"^/frontend/\"},{\"text\":\"后端\",\"link\":\"/backend/\",\"activeMatch\":\"^/backend/\"},{\"text\":\"服务\",\"link\":\"/environment/\",\"activeMatch\":\"^/environment/\"},{\"text\":\"软件\",\"link\":\"/software/\",\"activeMatch\":\"^/software/\"}],\"sidebar\":{\"/sharp-sword/\":[{\"text\":\"欲要善其事,必先利其器\",\"collapsible\":true,\"items\":[{\"text\":\"node\",\"link\":\"/sharp-sword/#node\"},{\"text\":\"nvm\",\"link\":\"/sharp-sword/#nvm\"},{\"text\":\"npm\",\"link\":\"/sharp-sword/#npm\"},{\"text\":\"pnpm\",\"link\":\"/sharp-sword/#pnpm\"},{\"text\":\"nrm\",\"link\":\"/sharp-sword/#nrm\"},{\"text\":\"yarn\",\"link\":\"/sharp-sword/yarn\"},{\"text\":\"brew\",\"link\":\"/sharp-sword/brew\"},{\"text\":\"composer\",\"link\":\"/backend/composer\"},{\"text\":\"git\",\"link\":\"/sharp-sword/git\"},{\"text\":\"map 地图\",\"link\":\"/sharp-sword/map\"},{\"text\":\"whistle proxy\",\"link\":\"/sharp-sword/whistle\"},{\"text\":\"* algolia\",\"link\":\"/sharp-sword/algolia\"}]}],\"/frontend/\":[{\"items\":[{\"text\":\"前端集合\",\"link\":\"/frontend/index\"},{\"text\":\"Ajax封装\",\"link\":\"/frontend/request\"},{\"text\":\"Vite\",\"link\":\"/frontend/vite\"},{\"text\":\"Vue2/3\",\"link\":\"/frontend/vue\"},{\"text\":\"ES6语法糖\",\"link\":\"/frontend/es6\"},{\"text\":\"NestJs\",\"link\":\"/frontend/nestjs\"},{\"text\":\"消除<异步>的传染性\",\"link\":\"/frontend/await\"},{\"text\":\"JS实现函数的重载\",\"link\":\"/frontend/overload\"},{\"text\":\"参数归一化\",\"link\":\"/frontend/normalization\"},{\"text\":\"UI组件的二次封装\",\"link\":\"/frontend/ui-packing\"},{\"text\":\"Canvas 应用\",\"link\":\"/frontend/canvas\"}]}],\"/backend/\":[{\"items\":[{\"text\":\"HTTP状态码\",\"link\":\"/backend/index\"},{\"text\":\"API开发\",\"link\":\"/backend/api\"},{\"text\":\"Composer\",\"link\":\"/backend/composer\"},{\"text\":\"Database\",\"link\":\"/backend/database\"},{\"text\":\"Laravel 8.x\",\"link\":\"/backend/laravel\"},{\"text\":\"ThinkPHP 6.x\",\"link\":\"/backend/thinkphp6\"},{\"text\":\"Fast-admin\",\"link\":\"/backend/fast-admin\"},{\"text\":\"PHP 高级函数\",\"link\":\"/backend/php-advanced\"},{\"text\":\"PHP BC运算函数\",\"link\":\"/backend/php-bc-function\"},{\"text\":\"PHP 扩展插件\",\"link\":\"/backend/php-vender\"},{\"text\":\"Python3\",\"link\":\"/backend/python\"},{\"text\":\"SHELL\",\"link\":\"/backend/shell\"},{\"text\":\"微信开发\",\"link\":\"/backend/wechat\"},{\"text\":\"~~彩蛋~~\",\"link\":\"/backend/dollar\"}]}],\"/environment/\":[{\"text\":\"服务器环境\",\"collapsible\":true,\"items\":[{\"text\":\"CentOS 7.x\",\"link\":\"/environment/centos\"},{\"text\":\"Crontab 定时任务\",\"link\":\"/environment/crontab\"},{\"text\":\"BT-宝塔\",\"link\":\"/environment/bt\"}]}]},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2019-present Deeperee\"}},\"locales\":{},\"scrollOffset\":90,\"cleanUrls\":false}")</script>
    
  </body>
</html>